//
//  HomeViewController.m
//  TelemedCloud
//
//  Created by YT on 2018/5/7.
//  Copyright © 2018年 YT. All rights reserved.
//

#import "HomeViewController.h"
#import "UserInfoClass.h"

@interface HomeViewController ()

@end

@implementation HomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
   
    UIView *redView = [UIView new];
    redView.backgroundColor = kRandomColor;
    [self.view addSubview:redView];
    redView.frame = CGRectMake(100, 100, 100, 100);
    [redView UILayoutCornerRadiusType:(UILayoutCornerRadiusTop) withCornerRadius:10];

}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    
    [DeviceInfo getPreferredLanguage];
   
    NSDictionary *dic = @{@"typeId":TYPEID,
                          @"loginUser" :@"18833333333",
                          @"pwd": @"222222",
                          };
    TLog(@"%@",dic);
    
    [[KYServerClient shareServerClient] sendPostWithURL:KY_SERVER_CONFIG.memberlogin parameters:dic toModel:nil showHubName:1 onCompletion:^(id object) {
        [[UserInfoClass share] loginWithInfo:object[@"memLogin"]];
        TLog(@"%@",[UserInfoClass share]);
    } onError:^(id object) {
        
    }];
    

//    
//    [KY_SERVER_CLIENT sendPostWithURL:KY_SERVER_CONFIG.memberlogin parameters:dic toModel:nil showHubName:1 onCompletion:^(id object) {
//        [KY_HUB_VIEW hideHubView];
//        [[UserInfoClass share] setValuesForKeysWithDictionary:object[@"memLogin"]];
//        
////        [[UserInfoClass share] loginWithInfo:object];
//    } onError:^(id object) {
//        
//    }];
    
    
}
  



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
